package com.ls.thread;

public class ThreadDemo2 {

    private static final Object LOCK = new Object();

    public static void main(String[] args) {
        testBlocked();
    }

    public static void testBlocked(){
        Thread t1 = new Thread(() -> {
            System.out.println("before syn...");
            synchronized (LOCK){
                System.out.println("in syn...");
            }
        }, "t1");
        System.out.println(String.format("state{%s}",t1.getState()));
        t1.start();
        synchronized (LOCK){
            System.out.println(String.format("state{%s}",t1.getState()));
        }
        System.out.println(String.format("state{%s}",t1.getState()));
    }
}
